import { useSelector } from "umi";
function useConnect(moudle: string[] | string): any {
  let state: any = {};
  useSelector((allState: any) => {
    //   传数组
    if (Array.isArray(moudle)) {
      moudle.forEach((item) => {
        // item 是 每一项模块名
        state[item] = allState[item];
      });
    } else {
      state = allState[moudle];
    }
  });
  return state;
}
export default useConnect;
